import React from "react";
import store from "../redux"
export default class Counter extends React.Component{
    constructor(props){
        super(props);
        this.state = {
          name:"counter component"
        }
    }
    render() {
        return (
          <div style={{background:"pink"}}>
            <h1>{store.getState().countVal}</h1>
            <h2>{this.state.name}</h2>
            <button onClick={() => store.dispatch({ type: "INCREMENT" })}>+</button>
            <button onClick={() => store.dispatch({ type: "DECREMENT" })}>-</button>
          </div>
        );
      }
}


